package cn.wenhe9.yygh.sta.controller;

import cn.wenhe9.yygh.common.result.ResultResponse;
import cn.wenhe9.yygh.model.order.OrderCountQueryVo;
import cn.wenhe9.yygh.order.client.OrderFeignClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @author DuJinliang
 * 2022/4/9
 */
@Api(tags = "订单统计接口")
@RequestMapping("/admin/statistics")
@RestController
public class StatisticsController {
    @Resource
    private OrderFeignClient orderFeignClient;

    /**
     * 获取预约统计数据
     * @param orderCountQueryVo OrderCountQueryVo
     * @return ResultResponse
     */
    @ApiOperation("获取预约统计数据")
    @GetMapping("/countMap")
    public ResultResponse getCountMap(OrderCountQueryVo orderCountQueryVo){
        Map<String, Object> countMap = orderFeignClient.getCountMap(orderCountQueryVo);
        return ResultResponse.ok(countMap);
    }
}
